package com.lfy.kcat.content.minio.config;
import com.lfy.kcat.content.minio.properties.MinioProperties;
import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

@Component
@Configuration
public class MyMinioConfig {
    @Autowired
//        这里引入的配置类，是自己的，不能引入第三方的，否则会报错
    MinioProperties minioProperties;
    @Bean
    MinioClient minioClient(){

        return MinioClient.builder()
                .endpoint(minioProperties.getEndpoint())
                .credentials(minioProperties.getAccessKey(),minioProperties.getSecretKey())
                .build();
    }
}
